package cn.fengkuok.jantis.user.domian.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import cn.fengkuok.core.domain.model.AbstractEntity;

@Entity
@Table(name = "T_USER")
@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class User extends AbstractEntity {

	private static final long serialVersionUID = 1L;

	@Column(length = 32)
	private String username;

	@Column(length = 32)
	private String password;

	@Column(length = 64)
	private String realname;

	@Column(length = 64)
	private String email;

	@Column(name = "access_level", length = 6)
	private Integer accessLevel;

	@Column(length = 4)
	private Integer enabled;

	@Column(length = 4)
	private Integer protect;

	@Column(name = "date_created")
	private Date dateCreated;

	@Column(name = "last_visit")
	private Date lastVisit;

	@Column(name = "login_count")
	private Integer loginCount;

	@Column(name = "lost_password_request_count")
	private Integer lostPasswordRequestCount;

	@Column(name = "failed_login_count")
	private Integer failedLoginCount;

	@Column(name = "cookie_string")
	private String cookieString;

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getRealname() {
		return realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Integer getAccessLevel() {
		return accessLevel;
	}

	public void setAccessLevel(Integer accessLevel) {
		this.accessLevel = accessLevel;
	}

	public Integer getEnabled() {
		return enabled;
	}

	public void setEnabled(Integer enabled) {
		this.enabled = enabled;
	}

	public Integer getProtect() {
		return protect;
	}

	public void setProtect(Integer protect) {
		this.protect = protect;
	}

	public Date getDateCreated() {
		return dateCreated;
	}

	public void setDateCreated(Date dateCreated) {
		this.dateCreated = dateCreated;
	}

	public Date getLastVisit() {
		return lastVisit;
	}

	public void setLastVisit(Date lastVisit) {
		this.lastVisit = lastVisit;
	}

	public Integer getLoginCount() {
		return loginCount;
	}

	public void setLoginCount(Integer loginCount) {
		this.loginCount = loginCount;
	}

	public Integer getLostPasswordRequestCount() {
		return lostPasswordRequestCount;
	}

	public void setLostPasswordRequestCount(Integer lostPasswordRequestCount) {
		this.lostPasswordRequestCount = lostPasswordRequestCount;
	}

	public Integer getFailedLoginCount() {
		return failedLoginCount;
	}

	public void setFailedLoginCount(Integer failedLoginCount) {
		this.failedLoginCount = failedLoginCount;
	}

	public String getCookieString() {
		return cookieString;
	}

	public void setCookieString(String cookieString) {
		this.cookieString = cookieString;
	}

}
